import functionnodes.FunctionNode;
import data.Value;

/**
 * @author loaner
 */
class functionnodes.FunctionNodeGetc extends FunctionNode {
	
	function FunctionNodeGetc() {
		super();
		funcname = "getc";
	}
	
	public function reduceValues( scope:Object, args:Array):Value
	{
		//first arg is the clip whose property we're getting,
		//second arg is the name of the property
		
		var mc:MovieClip = args[0].raw();
		var propname:String = args[1].raw();
		var returnvalue:Value;
		
		//when we find the type of this object, 
		//use it to cast the return value

		
		returnvalue = Value.makeTypedValue( mc[propname ] );	 
		return returnvalue;
	}

}